<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>welcome</title>
</head>
<body bgcolor="black">
<h2> <p style="color: dodgerblue"> 欢迎来到彤哥的文件托管系统</p></h2>
<table>
    <tr style="color:white; text-align: left;">
        <td >文件名</td>
        <td width="200px">文件大小</td>
    </tr>
    <tr style="color:greenyellow; text-align: left;" th:each="item:${files}">
        <td th:text="${item.fileName}+'.'+${item.extName}"></td>
        <td th:text="${item.fileSize/1024}+'kb'"></td>
        <span th:if="${item.id}!=null">
            <td width="60" style="color:blue; text-align: center;"><a target="_blank" th:href="'/file/show/'+${item.id}">查看</a></td>
        </span>
        <span th:if="${item.id}!=null">
            <td width="60" style="color:blue; text-align: center;"><a th:href="'/file/download/'+${item.id}">下载</a></td>
        </span>
        <span th:if="${item.id}!=null">
            <td width="60" style="color:blue; text-align: center;"><a th:href="'/file/delete/'+${item.id}">删除</a></td>
        </span>
    </tr>
</table>
<hr color="green" style="margin-top: 100px">
    <form id="upload-form" action="/file/upload" method="post" enctype="multipart/form-data" >
        <input  style="background-color:black;border: 0; color: yellow;" type="file" id="upload" name="file" />
        &nbsp;&nbsp;
        <input style="background-color:black;border: 0; color: yellow;"  type="submit" value="上传文件" />
    </form>
</body>
</html>